<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function pro(a) {
				return new Promise(function(resolve, reject) {
					setTimeout(function() {
						resolve(a * 2);
					}, 3000)
				});
			}

			//异步函数
			async function fn() {
				let r1 = await pro(1);
				console.log(r1);
				let r2 = await pro(2);
				console.log(r2);
				let r3 = await pro(3);
				console.log(r3);
				let r4 = await pro(4);
				console.log(r4);
			}

			fn();
		</script>
	</head>
	<body>
	</body>
</html>
